
  ; (async function () {
    const { data: { config: { allData } } } = await axios.get('/index/index')
    // console.log(allData);
    const widget_textssr = document.querySelector('.widget_textssr')
    const data = allData.filter((item) => item.id === 78017)
    // console.log(data);
    const newArr = data.map((item) => {
      
      return `
        <a class="style02" href="http://www.thefox.cn/alibaixiu.shtml"
          target="_blank"><strong>通知公告</strong>
          <h2>感谢广大好友</h2>  
          <p>${item.attr_value}</p>
        </a>
        `
      
    }).join('')
    widget_textssr.innerHTML = newArr
})()
axios.get('/index/index')
  .then(res => {
    $('.nav').append(res.data.allCate.map(({ catename, icon }) => {
      return `
      <li  class="menu-item menu-item-type-taxonomy menu-item-object-category"><a href="list.html"><span
                class="fa ${icon}"></span>${catename}</a></li>
      `
    }).join(''))
    const advlink = res.data.allLink.map(({ des, img, url }) => {
      if (des, img) {
        return `
        <li>
        <a href="${url}"><img src="http://124.223.14.236:8060/${img}" alt="">
          <p>${des}</p>
        </a>
      </li>
        `
      }
    }).join('')
    document.querySelector('.widget_comments ul').innerHTML = advlink
     const advreg = res.data.sideBanner.map(({ advimgdesc, advimglink, advimgsrc }) => {
      return `
      <a href="${advimglink}" rel="nofollow" target="_blank" title="${advimgdesc}">
      <img class="g430" style="width:360px;height:133px;" src="http://124.223.14.236:8060/${advimgsrc}" alt="${advimgdesc}">
    </a>
      `
    }).join('')
    document.querySelector('.sidebar .textwidget').innerHTML = advreg


    // console.log(res.data.allTag);
    const advremen = res.data.allTag.map(({ tagname }) => {
      return `
      <li><a title="" href="">${tagname}</a></li>
      `
    }).join('')
    document.querySelector('.widget .widget_tags_inner').innerHTML = advremen

  })
  axios.get('/index/recommend')
  .then(res => {
    // console.log(res.data.list)
    const advrelind = res.data.list.map(({ catename, pic, title, lovenum, id }) => {
      return `
      <li>
      <a target="_blank" href="">
        <span class="thumbnail">
          <img src="http://124.223.14.236:8060/${pic}" class="thumb" />
        </span>
        <span class="text">${title}</span>
        <span class="text-muted post-views">阅读(${lovenum})</span>
      </a>
    </li>
              `
    }).join('')
    document.querySelector('.widget ul').innerHTML = advrelind

    document.querySelector('.widget_postlist .items-01').innerHTML = advrelind
  })

  ; (async function () {
    const {data}=  await axios.get('/index/show?id=368')
    console.log(data)
    // document.querySelector('.article-header').innerHTML = data.info.map(item => {
    //   return `
    //    <div class="breadcrumbs">
    //           <span class="text-muted">当前位置：</span>
    //           <a href="">优点达资讯</a>
    //           <small>></small> 
    //           <a href="">${item.catename}</a> <small>></small> 
    //           <span class="text-muted">${item.content}</span>
    //         </div>
    //         <!-- 标题 -->
    //         <h1 class="article-title"><a href="">金戈铁马－骑着单车去打仗的二战德国国防军</a></h1>
    //         <!-- 标题描述 -->
    //         <ul class="article-meta">
    //           <li><a href="">${item.author}</a> 发布于 2015-01-01</li>
    //           <li>分类：<a href="" rel="category tag">${item.catename}</a></li>
    //           <li><span class="post-views">阅读(${item.click})</span></li>
    //           <li>评论(1)</li>
    //           <li></li>
    //         </ul>
    //   `
    // }).join('')
  })()